Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brp improvements #12

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

brp improvements #12

wants to merge 6 commits into from

Conversation

yshui
Copy link

@yshui yshui commented Jun 20, 2016

Main contribution of this patch is:

  • Make use of chroot() for stratum path resolution
  • Rewrite the config parser

Plus a couple of other changes.

yshui added 6 commits June 19, 2016 21:08
Ground work for vfork()+chroot() brp_realpath()

Also removes access() check in read_filter, because brp_realpath()
should have already made sure the file exists by using lstat()
Also, brp_realpath is replaced by brp_openplus

brp_realpath returns a path, which in most case is not what the caller
wanted. Causing them to repeat brp_realpath's work (e.g. lstat()).

The new function returns a file descriptor and stat instead.
Now instead of resolving symlink relative to stratum root manually, we
first chroot() into the stratum root, then let the kernel do the path
resolution.
Reduce the number of seteuid() calls, which is quite heavy
@Mouvedia
Copy link

Mouvedia commented Jun 6, 2018

@paradigm Is this useful for Poki? Should it be closed? Was this maybe addressed by the fork?

@paradigm
Copy link
Owner

paradigm commented Jun 6, 2018

All the development happens in github.com/bedrocklinux rather than my personal repo, and I check there for things like PRs. I completely missed this. I saw some of @yshui's other stuff and commented but then forgot about it as, again, I'm not in the habit of coming here. That's on me - I should have been watching this. It almost certainly notified me and I apparently just missed it.

Not only do I feel bad for not having been responded in terms of just being professional, but also because this is obviously a non-trivial amount of work (I didn't want to write a C config parser because it was too much work, and @yshui did so here), and even more so because this is very, very good stuff. The other big change here, using chroot(), is something I realized would be a good idea, independently, something like 18 months after this was made. Had I seen this a lot of time could have been saved. Poki might have been out by now.

I don't think we can use this as-is. Poki's equivalent has drifted too much; I did a clean re-write with some new ideas. I'm using chroot() already, and I moved the heavy lifting for configuration out of the C code to make it more flexible as I fiddle with finalizing the configuration changes. I think I could nab the use of unlikely() - that's not something I've been taking advantage of, but as @yshui demonstrates here it makes sense. I'll have to carefully review it to see if there's anything else.

I really, really hope I didn't discourage @yshui off from further contribution, as he/she was clearly ahead of me here and there's plenty of potential for further benefit. I'm greatly saddened I didn't watch github.com/paradigm more closely or that @yshui didn't reach out to any of the contact methods listed on the website that I do watch more actively.

@yshui If you're still interested in contributing there's definitely stuff we could use your help with. Let me know and I can try to catch you to where the project is now and highlight some areas that could use your touch. If you've lost interest in Bedrock in the last couple years, I don't blame you in the slightest.

@Mouvedia Thanks for bringing this to my attention. Wish you saw it two years ago.

I'll leave this open until either @yshui responds otherwise or I get time to review this in detail and see if there's other things like unlikely() that the current code base should adopt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants